import 'dart:developer';

import 'package:flutter/material.dart';
import 'package:news_demo/View/Apps/Index.dart';
import 'package:news_demo/View/Intercalate/Intercalate.dart';
import 'package:news_demo/View/MyAttention/Attention.dart';
import 'package:news_demo/View/UserHome/UserHomeIndex.dart';
import 'package:news_demo/main.dart';

import '../../MyService/MyService.dart';
class Drawer_left extends StatefulWidget {
  String UserName="";
  Drawer_left({Key? key,required this.UserName}) : super(key: key);

  @override
  State<Drawer_left> createState() => _Drawer_leftState(UserName:this.UserName);
}


class _Drawer_leftState extends State<Drawer_left> {
  late String UserName;
  _Drawer_leftState({required this.UserName});
  @override
  Widget build(BuildContext context) {
    return Drawer(
      width: 260,
      child: ListView(
        children: [
          UserAccountsDrawerHeader(
            accountName: Text(
              "名字:$UserName",
              style: const TextStyle(
              fontSize: 22,
            ),),
            accountEmail: Text("账号邮箱:123456789@qq.com",
            ),
            decoration: const BoxDecoration(
              color: Colors.black26
            ),
            currentAccountPicture: CircleAvatar(
              backgroundColor: Colors.amber,
            ),
          ),
          //个人中心
          Container(
            margin: EdgeInsets.fromLTRB(0, 0, 0, 8),
            color: Colors.black12,
            child:ListTile(
              onTap: (){
                Navigator.push(context, MaterialPageRoute(builder: (context)=>UserHomeIndex()));
              },
              title: Text("个人中心"),
            ),
          ),
          //我的关注列表
          Container(
            margin: EdgeInsets.fromLTRB(0, 0, 0, 8),
            color: Colors.black12,
            child:ListTile(
              onTap: (){
                Navigator.push(context, MaterialPageRoute(builder: (context)=>Attention()));
              },
              title: Text("我的关注列表"),
            ),
          ),
          //设置
          Container(
            margin: EdgeInsets.fromLTRB(0, 0, 0, 8),
            color: Colors.black12,
            child:ListTile(
              onTap: (){
                Navigator.push(context, MaterialPageRoute(builder: (context)=>Intercalate()));
              },
              title: Text("设置"),
            ),
          ),
          //我的客服
          Container(
            margin: EdgeInsets.fromLTRB(0, 0, 0, 8),
            color: Colors.black12,
            child:ListTile(
              onTap: (){
                Navigator.push(context, MaterialPageRoute(builder: (context)=>MyService()));
              },
              title: Text("我的客服"),
            ),
          ),
          //关于
          Container(
            margin: EdgeInsets.fromLTRB(0, 0, 0, 8),
            color: Colors.black12,
            child:ListTile(
              onTap: (){
                Navigator.push(context, MaterialPageRoute(builder: (context)=>Apps()));
              },
              title: Text("关于"),
            ),
          ),
        ],
      ),
    );
  }
}